package  
{
	import com.cupcakeengine.CKEngine;	
	import com.cupcakeengine.display.AbstractDisplay;
	import com.cupcakeengine.events.EventBroadcaster;
	import com.cupcakeengine.events.ScreenEvent;
	import com.joaosouza.core.GameController;
	import com.joaosouza.core.platform.IPlatformFactory;
	import com.joaosouza.core.platform.WebPlatform;	
	import com.joaosouza.data.Screens;
	
	/**
	 * ...
	 * @author João Vítor de Souza
	 */	
	[Frame(factoryClass="Preloader")]
	public class Main extends AbstractDisplay
	{
		// ___________________________________________________________________ CONSTANTS	
		
		// ___________________________________________________________________ CLASS PROPERTIES
		
		// ___________________________________________________________________ INSTANCE PROPERTIES
		
		private var _factory							: IPlatformFactory;
		
		// ___________________________________________________________________ GETTERS AND SETTERS
		
		// ___________________________________________________________________ CONSTRUCTOR
		
		public function Main() { super(); }
		
		// ___________________________________________________________________ PUBLIC METHODS
		
		override protected function init():void 
		{
			CKEngine.init(this, "name");
			
			_factory = new WebPlatform();			
			
			EventBroadcaster.addEventListener(ScreenEvent.CHANGE_SCREEN, onChangeScreen);	
			
			GameController.getInstance().init(_factory);
		}
		
		// ___________________________________________________________________ PRIVATE METHODS
		
		// ___________________________________________________________________ EVENTS
		
		private function onChangeScreen(e:ScreenEvent):void 
		{
			switch(e.id) {
				
			}
		}
	}

}